import React, { forwardRef } from 'react';
import { cva, type VariantProps } from 'class-variance-authority';

// Separator变体样式
const separatorVariants = cva(
  'shrink-0 bg-border',
  {
    variants: {
      orientation: {
        horizontal: 'h-px w-full',
        vertical: 'h-full w-px',
      },
    },
    defaultVariants: {
      orientation: 'horizontal',
    },
  }
);

// SeparatorProps类型定义
export type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof separatorVariants>;

// Separator组件
const Separator = forwardRef<HTMLDivElement, SeparatorProps>(({ className, orientation, ...props }, ref) => (
  <div ref={ref} className={separatorVariants({ orientation, className })} {...props} aria-orientation={orientation} />
));

// 导出组件
export {
  Separator,
  separatorVariants,
};